<?php
/**
 * brand 数据表模型
 * @author  yangjian <yangjian102621@gmail.com>
 */

namespace models;

use herosphp\filter\Filter;
use herosphp\model\C_Model;

class BrandModel extends C_Model {

    public function __construct() {

        //创建model对象并初始化数据表名称
        parent::__construct('brand');

        //设置表数据表主键，默认为id
        $this->setPrimaryKey('id');
        $this->autoPrimary = false;
        
        $this->filterMap = array(
            'name' => array(Filter::DFILTER_STRING, null, Filter::DFILTER_SANITIZE_TRIM,
                array("require" => "品名不能为空.", "length" => "标题长度必需在6-12之间.")),
        );
    }
} 